Skip to content

fix(security): consolidate Dependabot alerts and dependency updates - #417

Merged
Vic Perdana (vicperdana) merged 13 commits into
mainfrom
viperdan-microsoft-consolidate-dependabot-security-updates
Oct 26, 2026
Merged

Vic Perdana (vicperdana) merged 13 commits into
mainfrom
viperdan-microsoft-consolidate-dependabot-security-updates

Conversation

@vicperdana

Copy link
Copy Markdown
Contributor

PR Summary

Consolidates all open Dependabot alerts and stale Dependabot/security PRs into a single update that brings the monorepo's dependencies, CI and Dependabot configuration up to date.

Resolves all 48 open Dependabot alerts on main (44 npm in packages/vscode-extension/package-lock.json, 4 pip in requirements-docs.txt), plus 4 high-severity transitive NuGet advisories surfaced by dotnet list package --vulnerable that Dependabot was not tracking.

Closes #415.

Supersedes

PR What Notes
#414 vscode npm vulns (14 alerts) Commits merged here, then extended to cover all 44 npm alerts
#416 CI startup failures (codeql/vscode-ci), PSRule OSS license, vscode-test migration Commits merged here unchanged
#389 #394 #404 #406 #365 actions/checkout, setup-dotnet, download-artifact, codeql-action, setup-python Targeted pre-monorepo workflow files; superseded by latest-major bumps
#376 mkdocs-material / pymdown-extensions Superseded by newer patched versions
#367 #304 NetAnalyzers / SourceLink Targeted pre-monorepo src/ path; applied to packages/psdocs-azure

Changes

VS Code extension (packages/vscode-extension) (resolves 44 alerts)

GitHub Actions (all SHA-pinned with version comments)

Action From To
actions/checkout v4.2.2 v7.0.1
actions/upload-artifact v4.6.2 v7.0.2
actions/download-artifact v4.2.1 v8.0.2
actions/setup-dotnet v4.3.1 v6.0.0
actions/setup-node v4.4.0 v7.1.0
actions/setup-python v5.4.0 v7.0.0
actions/stale v9.1.0 v11.0.0
github/codeql-action v3.28.12 v4.39.1
  • Node.js 20.x (EOL) -> 22.x. This is required because @vscode/vsce 4 and @vscode/test-electron 3 need Node >= 22.
  • Docs Python 3.9 (EOL, and dropped by setup-python v7) -> 3.12.
  • No workflow uses pull_request_target/workflow_run, so checkout v7's fork-checkout restriction has no effect.

NuGet

  • PSDocs.Tests / PSDocs.Benchmark (net7.0): pin patched transitive versions:
  • PSDocs.Azure: Microsoft.CodeAnalysis.NetAnalyzers 7.0.4 -> 9.0.0, which matches PSDocs.
  • PSDocs.Azure: Microsoft.SourceLink.GitHub 1.1.1 -> 10.0.402. Dependabot proposed 8.0.0, but I skipped it because it pulls Microsoft.Build.Tasks.Git 8.0.0, which is affected by GHSA-23fw-v26w-5fgq. The 10.0.402 build tasks target net8.0, so they work with the .NET 8 SDK used in CI.

Docs (requirements-docs.txt) (resolves 4 alerts)

Dependabot config (.github/dependabot.yml)

  • Root cause of the stale PRs: NuGet pointed at /, which has no projects after the monorepo migration, and npm was not configured at all.
  • NuGet now uses directories for the four real projects. Added an npm entry for /packages/vscode-extension.
  • Grouped updates per ecosystem and moved version updates to weekly. Security updates are unaffected by the schedule.
  • Removed the deprecated reviewers key, since CODEOWNERS already assigns @azure/psdocs-azure.

Validation

Command Result
npm audit --package-lock-only (packages/vscode-extension) Passed: found 0 vulnerabilities (was 24 / 44 alerts)
npm ci && npm run compile Passed
npm run lint Passed: 0 errors (2 existing warnings in src/extension.ts)
npm run pack Passed: VSIX produced
npm test (VS Code 1.143.0, macOS arm64) Passed: harness launches and exits 0; no tests are defined yet (placeholder suite)
Reconcile all 48 open alerts against branch lockfile/requirements Passed: every package is at or above its patched version, or removed
dotnet list package --vulnerable --include-transitive (all 4 projects) Passed: no vulnerable packages
dotnet build -c Release (all 4 projects) Passed: succeeded; PSDocs.Azure has the same 60 CS1591 warnings as main
./build.ps1 -Package psdocs -Build -Test (.NET 8 SDK + 7 runtime) Passed: xunit 32/32 passed. Pester shows 89 passed / 17 failed, identical to main locally (existing local-env failures in New-PSDocumentOption/selectors)
Invoke-Build Build + Invoke-Build TestModule (packages/psdocs-azure) Passed: build succeeded, Pester 23/23 passed
pip-audit -r requirements-docs.txt Passed: no known vulnerabilities
mkdocs build --strict Passed
actionlint .github/workflows/* Passed: no new findings (same 17 shellcheck warnings as main, tracked in #415)
check-jsonschema --builtin-schema vendor.dependabot .github/dependabot.yml Passed

PR Checklist

  • PR has a meaningful title
  • Summarized changes
  • Change is not breaking. Contributor/CI tooling only: building the VS Code extension now requires Node.js >= 22. Shipped module APIs are unchanged.
  • This PR is ready to merge and is not Work in Progress

Vic Perdana (vicperdana) and others added 13 commits May 11, 2026 16:26
…4 medium, 2 low)

Fix all open Dependabot alerts in packages/vscode-extension/package-lock.json
by cherry-picking security-relevant changes from upstream microsoft/PSDocs-vscode
and adding version-scoped npm overrides. Local subtree divergence (eslint
flat-config, monorepo URLs, engines-aligned @types/vscode) is preserved.

Direct dependency changes (package.json):
- Replace deprecated vscode-test ^1.6.1 with @vscode/test-electron ^2.5.2
  (eliminates the @tootallnate/once + http-proxy-agent vulnerable chain)
- Bump @vscode/vsce ^3.3.2 -> ^3.7.1 (cascades fresh transitives)

Source change (src/test/runTest.ts):
- Update import: vscode-test -> @vscode/test-electron (identical runTests API)

New top-level overrides block (npm 9+ version-scoped syntax to surgically
patch transitives without breaking same-tree consumers of other majors):
- serialize-javascript ^7.0.5
- flatted ^3.4.2
- markdown-it ^14.1.1
- qs ^6.14.2
- underscore ^1.13.8
- diff ^8.0.3
- ajv@<6.14.0 -> ^6.14.0
- picomatch@<2.3.2 -> ^2.3.2
- brace-expansion@<1.1.13 -> ^1.1.13
- brace-expansion@>=2.0.0 <2.0.3 -> ^2.0.3
- minimatch@<3.1.4 -> ^3.1.4
- minimatch@>=5.0.0 <5.1.8 -> ^5.1.8
- minimatch@>=9.0.0 <9.0.7 -> ^9.0.7

Alerts addressed:
- GHSA-qj8w-gfj5-8c6v / CVE-2026-34043  serialize-javascript DoS (medium) #34
- GHSA-5c6j-r48x-rmvq                   serialize-javascript RCE (high) #25
- GHSA-f886-m6hf-6m8v / CVE-2026-33750  brace-expansion v1 hang (medium) #33
- GHSA-3v7f-55p6-f55p / CVE-2026-33672  picomatch method injection (medium) #31
- GHSA-rf6f-7fwh-wjgh / CVE-2026-33228  flatted prototype pollution (high) #29
- GHSA-vpq2-c234-7xj6 / CVE-2026-3449   @tootallnate/once control-flow (low) #27
- GHSA-qpx9-hpmf-5gmw / CVE-2026-27601  underscore unlimited recursion (high) #26
- GHSA-7r86-cg39-jmmj / CVE-2026-27903  minimatch v3/v5/v9 ReDoS (high) #22, #23, #24
- GHSA-23c5-xmqv-rm74 / CVE-2026-27904  minimatch ReDoS via extglobs (high) #20
- GHSA-3ppc-4f35-3m26 / CVE-2026-26996  minimatch wildcard ReDoS (high) #16
- GHSA-38c4-r59v-3vqw / CVE-2026-2327   markdown-it ReDoS (medium) #11
- GHSA-w7fw-mjwx-w883 / CVE-2026-2391   qs arrayLimit DoS (low) #10

Validation:
- npm audit reports 0 vulnerabilities
- All 14 alerts cross-checked against resolved lockfile versions
- npm run compile, lint, pack all clean (2 pre-existing ESLint warnings
  in src/extension.ts, unrelated)
- Dropped from node_modules: @tootallnate/once, vscode-test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Address all 4 review comments on PR #414:

- Convert previously-unscoped overrides (serialize-javascript, flatted,
  markdown-it, qs, underscore, diff) to version-scoped form. Each now only
  applies to versions in the vulnerable range, eliminating the risk of
  forcing major-version upgrades on out-of-scope consumers.

- Bump brace-expansion v1 override target from ^1.1.13 -> ^1.1.14 (and
  trigger range to <1.1.14) so the override deterministically lands on
  the version the lockfile already resolved.

- Bump minimatch v3 override target from ^3.1.4 -> ^3.1.5 (and trigger
  range to <3.1.5) for the same deterministic-resolution reason.

- Replace blanket diff ^8.0.3 with two scoped ranges:
    diff@>=5.0.0 <5.2.2 -> ^5.2.2  (patches v5 line in place)
    diff@>=6.0.0 <8.0.3 -> ^8.0.3  (patches v6/v7 line, matches what
                                    mocha 11.7.5 already pulls in)

Validation:
- npm audit reports 0 vulnerabilities
- All 14 originally-flagged alerts remain resolved
- npm run compile, lint, pack all clean

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The version-scoped `diff@>=6.0.0 <8.0.3 -> ^8.0.3` override caused
`npm ci` to fail under npm 10.8.2 (used by CI) with:

  npm error EUSAGE
  npm error `npm ci` can only install packages when your package.json
  npm error and package-lock.json or npm-shrinkwrap.json are in sync.
  npm error Missing: diff@7.0.0 from lock file

This is an npm 10 limitation: its `npm ci` lockfile validator does not
fully consult version-scoped overrides when determining whether the
lockfile satisfies a consumer's declared range (mocha 11.7.5 declares
`diff: ^7.0.0` but the override redirects to 8.0.4).

Switching to a nested override under mocha — matching upstream PR
microsoft/PSDocs-vscode#539 — is npm-10-compatible AND even more
narrowly scoped than the version-range form (only mocha's diff
consumer is affected). The v5 diff CVE range is no longer in the
tree (mocha now uses ^7.0.0, not ^5.0.0), so a separate v5 patch is
unnecessary.

Also regenerated the lockfile with npm 10.8.2 to ensure parity with
the CI runtime.

Validation:
- npm install (npm 10.8.2) -> 0 vulnerabilities
- npm ci (npm 10.8.2) -> succeeds, 0 vulnerabilities
- npm run compile, lint, pack all clean
- diff still resolves to 8.0.4 (patched)
- All 14 originally-flagged alerts remain resolved

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both workflows failed at startup (0s) on every push to main because of
invalid workflow-file config, leaving main with a persistent red status.

- codeql.yml: the `paths` input to codeql-action/init was a YAML sequence,
  but the action input must be a scalar string. Convert to a scalar so the
  `with:` block is valid.
- vscode-ci.yml: the publish step used the `secrets` context in an `if:`
  conditional, which is not allowed. Reference `env.VSCE_PAT` instead (the
  step already maps the secret into env).

Validated with actionlint: no syntax/expression startup errors remain.

Fixes #415

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Enabling the previously-broken codeql.yml and vscode-ci.yml workflows
surfaced two pre-existing failures that those startup errors had masked.

PSRule MSFT.OSS.License (codeql.yml `oss` job, repo-root scan):
- Add a root ps-rule.yaml so the monorepo-wide scan ignores generated
  resource designers (*.Designer.cs) and the vendored packages/psdocs and
  packages/vscode-extension subtrees, mirroring the per-package configs.
- build.ps1 is ignored because it needs a shebang on line 1 (for the
  documented `./build.ps1`), which is incompatible with the rule requiring
  the license header to be the first line.
- Add the standard license header to scripts/extract-release-notes.ps1.

vscode-ci.yml test jobs (TypeError: glob is not a function):
- package.json was bumped to glob ^11, whose callback API was removed in
  v9. Update the mocha bootstrap (src/test/suite/index.ts) to use the
  promise-based glob API. Verified with `npm ci && npm run compile`.

Verified the OSS scan locally with PSRule 2.9.0 + MSFT.OSS 1.1.0: 0 failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Windows test jobs failed with "Failed to get VS Code archive location".
The deprecated vscode-test@1.6.1 hardcodes the legacy `win32-archive`
(32-bit) platform, which modern VS Code (1.126.0) no longer publishes, so
the download URL could not be resolved on Windows (Linux/macOS were
unaffected as their platform strings still exist).

Migrate the integration-test harness to the maintained successor
@vscode/test-electron ^2.5.2, which resolves `win32-x64-archive`. Pinned to
the 2.x line because 3.x requires Node >=22 while CI runs Node 20. The
runTests API is unchanged.

Verified locally: version resolves and VS Code downloads successfully
(the prior failure point); compile passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After the test harness could download VS Code again, the macOS test job
failed at launch: "IPC handle ... is longer than 103 chars" /
"listen EINVAL". VS Code's default user-data-dir under .vscode-test
produces a Unix domain socket path that exceeds the macOS 103-char
sun_path limit.

Launch the test instance with a short --user-data-dir under the OS temp
directory. No-op on Windows (named pipes) and Linux (longer limit, shorter
path), but unblocks macOS.

Verified locally on macOS: VS Code launches, the extension host starts, and
mocha completes successfully (exit 0).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89e0a8f4-17aa-4419-9705-4b96e4494c53
- Bump @vscode/vsce ^3.7.1 -> ^4.0.0 (drops vulnerable markdown-it,
  secretlint/globby/fast-glob/micromatch/braces chain)
- Bump mocha ^11.1.0 -> ^11.7.5 (chokidar/braces chain)
- Bump @vscode/test-electron ^2.5.2 -> ^3.1.0 (supports renamed macOS
  'Code' binary in current VS Code)
- Regenerate lockfile from scratch so transitives resolve to patched
  versions; replace broad overrides with mocha-scoped diff and
  serialize-javascript overrides
- npm audit: 0 vulnerabilities

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89e0a8f4-17aa-4419-9705-4b96e4494c53
- actions/checkout v4.2.2 -> v7.0.1
- actions/upload-artifact v4.6.2 -> v7.0.2
- actions/download-artifact v4.2.1 -> v8.0.2
- actions/setup-dotnet v4.3.1 -> v6.0.0
- actions/setup-node v4.4.0 -> v7.1.0
- actions/setup-python v5.4.0 -> v7.0.0
- actions/stale v9.1.0 -> v11.0.0
- github/codeql-action v3.28.12 -> v4.39.1
- Node.js 20.x (EOL) -> 22.x (required by @vscode/vsce 4 / test-electron 3)
- Docs Python 3.9 (EOL, dropped by setup-python v7) -> 3.12

Supersedes #389, #394, #404, #406, #365.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89e0a8f4-17aa-4419-9705-4b96e4494c53
- PSDocs.Tests / PSDocs.Benchmark: pin patched transitive versions
  System.Data.SqlClient 4.8.6 (GHSA-98g6-xh36-x2p7),
  System.Formats.Asn1 8.0.1 (GHSA-447r-wph3-92pm),
  System.Net.Http 4.3.4 (GHSA-7jgj-8wvc-jh57, benchmark),
  System.Text.RegularExpressions 4.3.1 (GHSA-cmhx-cq75-c4mj, benchmark)
- PSDocs.Azure: Microsoft.CodeAnalysis.NetAnalyzers 7.0.4 -> 9.0.0
  (aligns with PSDocs; supersedes #367)
- PSDocs.Azure: Microsoft.SourceLink.GitHub 1.1.1 -> 10.0.402
  (supersedes #304; skips 8.0.0 which pulls Microsoft.Build.Tasks.Git
  8.0.0 affected by GHSA-23fw-v26w-5fgq)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89e0a8f4-17aa-4419-9705-4b96e4494c53
- mkdocs-material 9.7.6 -> 9.7.7 (PYSEC-2026-3864)
- pymdown-extensions 10.21.2 -> 12.3 (PYSEC-2026-2999, PYSEC-2026-3609,
  PYSEC-2026-3654)
- pygments 2.20.0 -> 2.21.0, mike 2.1.3 -> 2.2.0,
  mkdocs-redirects 1.2.2 -> 1.2.3

Supersedes #376.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89e0a8f4-17aa-4419-9705-4b96e4494c53
- Point NuGet updates at the actual project directories under packages/
- Add npm updates for packages/vscode-extension (previously untracked)
- Group updates per ecosystem and move version updates to weekly
- Drop deprecated 'reviewers' key; reviewers come from CODEOWNERS

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 89e0a8f4-17aa-4419-9705-4b96e4494c53
@vicperdana
Vic Perdana (vicperdana) merged commit a139aef into main Oct 26, 2026
23 checks passed
@vicperdana
Vic Perdana (vicperdana) deleted the viperdan-microsoft-consolidate-dependabot-security-updates branch October 26, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: codeql.yml and vscode-ci.yml fail at startup on every push to main

2 participants